cmake_minimum_required(VERSION 3.0)

project(demo)

set(CMAKE_CXX_STANDARD 17)      # C++17


# 设置输出目录
# set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/build)


# 设置头文件目录
include_directories(${PROJECT_SOURCE_DIR}/include)


# 获取源文件列表
# aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/src SRC_LIST)      # 获取当前目录下的所有源文件
file(GLOB_RECURSE SRC_LIST ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)         # 递归搜索获取所有源文件
# file(GLOB_RECURSE INCLUDE_LIST ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h)




# 1. 生成可执行文件
add_executable(exec  ${SRC_LIST} main.cpp)



# 设置库文件输出目录
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

# 2. 生成静态库
add_library(calc1 STATIC ${SRC_LIST})


# 3. 生成动态库
add_library(calc2 SHARED ${SRC_LIST})